<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="org.springside.modules.security.springsecurity.SpringSecurityUtils" %>
<%@ include file="/common/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>帐号管理 - <s:text name="context.title"/></title>
	<%@ include file="/common/meta.jsp" %>
	  <script type="text/javascript" language="javascript">

          var pageTotalPages = "1";
          var pageNo = "";
        $(document).ready(function() {
        	var pageTotalPages = $("#pageTotalPages").val();
            var pageNo = $("#pageNo").val();
            $("#pager").pager({ pagenumber: pageNo, pagecount: pageTotalPages, buttonClickCallback: PageClick });
        });

        PageClick = function(pageclickednumber) {
            $("#pager").pager({ pagenumber: pageclickednumber, pagecount: pageTotalPages, buttonClickCallback: PageClick });
           // $("#result").html("Clicked Page " + pageclickednumber);
            jumpPage(pageclickednumber);
        }
       
    </script>
</head>

<body>
<h1 class="title01"><img src="${ctx}/images/02_15.gif" width="45" height="42" class="fl"/><security:authorize ifAnyGranted="ROLE_修改用户">
				<a href="user!input.action">增加新用户</a>
			</security:authorize>用户管理 </h1>
			
	<form id="mainForm" action="user.action" method="post">
		<input type="hidden" name="page.pageNo" id="pageNo" value="${page.pageNo}"/>
		<input type="hidden" name="page.orderBy" id="orderBy" value="${page.orderBy}"/>
		<input type="hidden" name="page.order" id="order" value="${page.order}"/>
		
		<fieldset class="fs_ys" style="width: 800px">
<legend>查询</legend>
<table align="center" id="contentTable" class="table_ys_input" >
			<tr>
				<td nowrap>姓名&nbsp;</td>
				<td><input type="text" name="filter_LIKES_name" value="${param['filter_LIKES_name']}"/>&nbsp;</td>
				<td nowrap>登录账号&nbsp;</td>
				<td colspan="">
					<input type="text" name="filter_EQS_loginName" value="${param['filter_EQS_loginName']}"/>
				&nbsp;</td>
				<td><center><input type="submit" value="  查询  "/></center></td>
			</tr>
		</table>
				
		</fieldset>
		
		<input type="hidden" id="pageTotalPages"  value="${page.totalPages}"/>

		<div id="message"><s:actionmessage theme="custom" cssClass="success"/></div>
		
		<div id="content">
			<table id="contentTable" class="table_ys tableColor">
				<tr>
					<th nowrap="nowrap"><a href="javascript:sort('loginName','asc')">登录名</a></th>
					<th nowrap="nowrap"><a href="javascript:sort('name','asc')">姓名</a></th>
					<th nowrap="nowrap"><a href="javascript:sort('email','asc')">电邮</a></th>
					<th>角色</th>
					<th nowrap="nowrap">操作</th>
				</tr>

				<s:iterator value="page.result">
					<tr>
						<td>${loginName}&nbsp;&nbsp;</td>
						<td>${name}&nbsp;&nbsp;</td>
						<td>${email}&nbsp;&nbsp;</td>
						<td>${roleNames}&nbsp;&nbsp;</td>
						<td nowrap="nowrap">&nbsp;
							<security:authorize ifAnyGranted="ROLE_浏览用户">
								<security:authorize ifNotGranted="ROLE_修改用户">
									<a class="ui-state-default ui-corner-al" style="padding:3px 10px;text-decoration:none;" href="user!input.action?id=${id}">查看</a>&nbsp;
								</security:authorize>
							</security:authorize>

							<security:authorize ifAnyGranted="ROLE_修改用户">
								<a class="ui-state-default ui-corner-al" style="padding:3px 10px;text-decoration:none;" href="user!input.action?id=${id}">修改</a>&nbsp;
								<a class="ui-state-default ui-corner-al" style="padding:3px 10px;text-decoration:none;" href="user!delete.action?id=${id}" onClick="return confirm('确定删除?')">删除</a>
							</security:authorize>
						&nbsp;</td>
					</tr>
				</s:iterator>
			</table>
		</div>

		<div>
			<div align="center" id="pager" ></div>

			
		</div>
	</form>
</body>
</html>
